#include <iostream>
#include<vector>
#include<string>
#include<cstring>
#include<unordered_set>
#include<algorithm>
using namespace std;
vector<string> v;


int main() {
    int N = 0;
    cin >> N;
    unordered_set<string> set;
    while (N--)
    {
        string s;
        cin >> s;
        sort(s.begin(), s.end());
        set.insert(s);
    }
    cout << set.size();




}